/**
 *上海交大-鹏越惊虹
 */

package org.infosec.lc.exercises.databases.mysql;

import java.util.List;
import java.util.Set;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.support.rowset.SqlRowSet;
import org.springframework.stereotype.Controller;
import org.springframework.stereotype.Repository;

/**  
 * @Title: MySqlDao.java
 * @Package org.infosec.lc.exercises.databases.mysql.MySqlDao
 * @Description: TODO
 * @author 林超 
 * @date Apr 9, 2013 10:37:19 AM
 * @version V1.0  
 */
@Controller("mysqldao")
public class MySqlDao {
	
	@Autowired(required = true)
	private JdbcTemplate jdbcTemplate;
	
	public void getAppDb(){
		jdbcTemplate.execute("use sharkappdb;");
		int s=jdbcTemplate.queryForInt("select count(*) from sysm_user");
		
		System.out.println(s);
	}
	public void getDataBase(){
		List s=jdbcTemplate.queryForList("show databases;");
		
		System.out.println(s);
	}

}
/**Code End*/